<#import "/macro.ftl" as m>
<@m.page_header title='后台' />
<script type="text/javascript" src="/assets/calendar/calendar.js"></script>
<link rel="stylesheet" href="/assets/calendar/calendar.css">

<div id="page-content-wrapper">

    <div id="page-title">
        <h3>

        </h3>

    </div>
    <div id="page-content">
        <div class="form-row">
            <#--<div class="form-label col-md-2">
                <label for="">
                    设置法定假日：
                </label>
            </div>-->
            <div class="form-label col-md-4">
                <form action="" method="post">
                    <div id="g-calendar" class="g-calendar">
                        <span class="g-calendar-prev">&lt;</span>
                        <span class="g-calendar-next">&gt;</span>

                        <div class="g-calendar-hd"></div>
                        <div class="g-calendar-tit"></div>
                        <div class="g-calendar-bd"></div>
                    </div>
                </form>
            </div>
            <div class="form-label col-md-4">
                <div>
                    <a id="statutorydays" href="javascript:;" class="btn medium primary-bg g-calendar-on-on">
                        <span class="button-content">
                            设置节假日
                        </span>
                    </a>
                </div>
                <br/>
                <br/>
                <div>
                    <a id="workdays" href="javascript:;" class="btn medium primary-bg g-calendar-on-work">
                    <span class="button-content">
                        设置工作日
                    </span>
                    </a>
                </div>
                <br/>
                <br/>
                <div>
                    <a id="cancel" href="javascript:;" class="btn medium primary-bg">
                        <span class="button-content">
                            取消选择
                        </span>
                    </a>
                </div>
            </div>
        </div>
    </div>
</div>


<script type="text/javascript">
    var days = new Array();
<#list list as statutory>
    days.push({"statutoryDays": "${(statutory.statutoryDays?string('yyyy-MM-dd'))}", "type": "${statutory.type}"});
</#list>

    //---------实例化
    new CLT_calendar({'wrapId': 'g-calendar','days': days, 'nextUrl': '/calendar/change', 'preUrl': '/calendar/change', 'month': "${month}"});

    $("#statutorydays").click(function(){
        $('form').attr("action", "/calendar/addstatutorydays?stat=1");
        $('form').submit();
    });

    $("#workdays").click(function(){
        $('form').attr("action", "/calendar/addstatutorydays?stat=2");
        $('form').submit();
    });

    $("#cancel").click(function(){
        $('form').attr("action", "/calendar/cancel");
        $('form').submit();
    });
</script>


